<!--{template admin/header_tpl}-->

<div class="mainarea">
<div class="maininner">


	<div class="tabs_header">
		<ul class="tabs">
			<li$actives[all]><a href="{SITEURL}admin/admin_work/index/"><span>浏览全部作品</span></a></li>
			<li$actives[0]><a href="{SITEURL}admin/admin_work/index/?ac=admin_work&perpage=20&status=0&searchsubmit=1&tab=0"><span>未审核作品</span></a></li>
		</ul>
	</div>
	
	<form method="get" action="{SITEURL}admin/admin_work/index/">
		<div class="block style4">

			<table cellspacing="3" cellpadding="3">
			<!--{if $allowmanage}-->
			<tr><th>作者UID</th><td><input type="text" name="uid" value="$_GET[uid]"></td>
				<th>作者名</th><td><input type="text" name="username" value="$_GET[username]"></td>
			</tr>
			<!--{/if}-->
			<tr><th>标题*</th><td><input type="text" name="title" value="$_GET[title]"></td>
				<th>内容*</th><td><input type="text" name="description" value="$_GET[description]">*表示支持模糊查询</td>
			</tr>
			<tr>
				<th>作品状态</th><td>
				<select name="status">
				<option value="">不限</option>
				<option value="0"<!--{if $_GET[status] == '0'}--> selected<!--{/if}-->>未审核</option>
				<option value="1"<!--{if $_GET[status] == '1'}--> selected<!--{/if}-->>审核通过</option>
				<option value="2"<!--{if $_GET[status] == '2'}--> selected<!--{/if}-->>作品推荐</option>
				<option value="3"<!--{if $_GET[status] == '3'}--> selected<!--{/if}-->>用户删除</option>
				</select>
				</td>
				<th>发布IP</th><td colspan="3"><input type="text" name="postip" value="$_GET[postip]"></td>
			</tr>
			<tr>
				<th>指定作品ID</th>
				<td colspan="3">
					<input type="text" name="wid" value="$_GET[wid]" />
				</td>
			</tr>
			<tr><th>查看数</th><td colspan="3">
				<input type="text" name="viewnum1" value="$_GET[viewnum1]" size="10"> ~
				<input type="text" name="viewnum2" value="$_GET[viewnum2]" size="10">
			</td></tr>
			<tr><th>回复数</th><td colspan="3">
				<input type="text" name="replynum1" value="$_GET[replynum1]" size="10"> ~
				<input type="text" name="replynum2" value="$_GET[replynum2]" size="10">
			</td></tr>
			<tr><th>喜欢数</th><td colspan="3">
				<input type="text" name="likenum1" value="$_GET[likenum1]" size="10"> ~
				<input type="text" name="likenum2" value="$_GET[likenum2]" size="10">
			</td></tr>
			<tr><th>发布时间</th><td colspan="3">
				<input type="text" name="dateline1" value="$_GET[dateline1]" size="10"> ~
				<input type="text" name="dateline2" value="$_GET[dateline2]" size="10"> (YYYY-MM-DD)
			</td></tr>

			<tr><th>结果排序</th>
			<td colspan="3">
			<select name="orderby">
			<option value="">默认排序</option>
			<option value="dateline"$orderby[dateline]>发布时间</option>
			<option value="viewnum"$orderby[viewnum]>查看数</option>
			<option value="replynum"$orderby[replynum]>回复数</option>
			<option value="likenum"$orderby[likenum]>喜欢数</option>
			</select>
			<select name="ordersc">
			<option value="desc"$ordersc[desc]>递减</option>
			<option value="asc"$ordersc[asc]>递增</option>
			</select>
			<select name="perpage">
			<option value="20"$perpages[20]>每页显示20个</option>
			<option value="50"$perpages[50]>每页显示50个</option>
			<option value="100"$perpages[100]>每页显示100个</option>
			<option value="1000"$perpages[1000]>一次处理1000个</option>
			</select>
			<input type="hidden" name="ac" value="admin_work">
			<input type="submit" name="searchsubmit" value="搜索" class="submit">
			</td>
			</tr>
			</table>

		</div>
		</form>

<!--{if $list}-->

	<form method="post" action="{SITEURL}admin/admin_work/batchop/">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	<input type="hidden" name="refer" value="<!--{eval echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] }-->" />

	<div class="bdrcontent">
	
	<!--{if $perpage>100}-->
		<p>总共有满足条件的数据 <strong>$count</strong> 个</p>
		<!--{loop $list $value}-->
		<input type="hidden" name="ids[]" value="$value[wid]">
		<!--{/loop}-->
	
	<!--{else}-->
		<table cellspacing="0" cellpadding="0" class="formtable">
		<tr>
			<td width="5%">&nbsp;</td>
			<th width="40%">标题</th>
			<th width="45%">购买</th>
			<td width="5%">状态</td>
			<th width="4%">操作</th>
		</tr>
		<!--{loop $list $value}-->
		<tr>
			<td>
				<input type="checkbox" name="ids[]" value="$value[wid]">
			</td>
			<td>
				<a href="{SITEURL}work/index/{$value[wid]}" target="_blank">$value[title]
				<p><img src="{$value[thumbimg]}" width="100" /></p>
				</a>
				<p class="gray">
					<a href="{SITEURL}home/index/{$value[uid]}">$value[name]</a> (UID:{$value[uid]})
					<!--{if $value[postip]}-->($value[postip])<!--{/if}-->
					&nbsp; <!--{date('Y-m-d H:i',$value[dateline])}-->
					<br>喜欢({$value[likenum]}) / 回复({$value[replynum]}) / 查看({$value[viewnum]}) / 期待价格({$value[expectprice]})
				</p>
			</td>
			<td>
				<p>当前价格：<input type="text" size="5" value="{$value[price]}" name="price[{$value[wid]}]"></p>
					<br />
				<p>
					总量<input type="text" size="2" value="{$value[totalnum]}" name="totalnum[{$value[wid]}]" id="totalnum_{$value[wid]}" onkeyup="count_reserve({$value[wid]})">
					 － 卖出数量：<input type="text" size="2" value="{$value[soldoutnum]}" name="soldoutnum[{$value[wid]}]" id="soldoutnum_{$value[wid]}" onkeyup="count_reserve($value[wid])">
					 = 剩余数量 <input type="text" size="2" value="{$value[reserve]}" name="reserve[{$value[wid]}]" id="reserve_{$value[wid]}">
				</p>
					<br />
				<p>购买链接<input type="text" size="20" value="{$value[shopurl]}" name="shopurl[{$value[wid]}]"></p>
				
			</td>
			<td>
				<b>{$value[workstatus]}</b>
			</td>
			<td>
				<a href="{SITEURL}work/edit/{$value[wid]}" target="_blank">编辑</a>&nbsp;
			</td>
		</tr>
		<!--{/loop}-->
		</table>
	<!--{/if}-->
	</div>

	<div class="footactions">
		<input type="checkbox" id="chkall" name="chkall" onclick="checkAll(this.form, 'ids')">全选 &nbsp;&nbsp;

		<input type="radio" name="optype" value="1" checked> 通过审核
		<input type="radio" name="optype" value="2"> 重新审核
		<input type="radio" name="optype" value="3"> 推荐作品
		<input type="radio" name="optype" value="4"> 取消推荐
		<input type="radio" name="optype" value="5"> 恢复删除
		<input type="radio" name="optype" value="6"> 彻底删除
				
		<input type="submit" name="listsubmit" value="批量管理" class="submit">
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="submit" name="shopsubmit" value="更新购买信息" class="submit">
		<div class="pages">$multi</div>
	</div>

	</form>
<!--{else}-->
	<div class="bdrcontent">
		<p>指定条件下还没有数据</p>
	</div>
<!--{/if}-->
</div>
</div>

<div class="side">
	<!--{template admin/side}-->
</div>
<script type="text/javascript">
	function count_reserve(id){
		var totalnum = $('#totalnum_'+id).val();
		var soldoutnum = $('#soldoutnum_'+id).val();
		var reserve = $('#reserve_'+id).val();
		$('#reserve_'+id).val(totalnum-soldoutnum);
	}
</script>
<!--{template admin/footer_tpl}-->